<template>
<div>
  <el-row>
    <el-col :span="12" :offset="6">
      用户名：<el-input v-model="user.name" placeholder="请输入内容"></el-input>
      密码：<el-input placeholder="请输入密码" v-model="user.password" show-password></el-input>
      <el-button type="success" @click="loginByName">登录</el-button>
    </el-col>
  </el-row>
</div>
</template>

<script>
export default {
  name: "Login",
  data(){
    return{
      user:{}
    }
  },
  methods:{
    loginByName(){
      this.$http.post('http://localhost:8081/user/loginByName',this.user).then(res=>{
        this.$router.push('/success');/*跳转路由*/
      })
    }
  }

}
</script>

<style scoped>

</style>
